package com.mjk.manager.magicapi.plugin.webservice.resource;

import com.mjk.manager.magicapi.core.core.service.AbstractPathMagicResourceStorage;
import com.mjk.manager.magicapi.plugin.task.model.TaskInfo;
import com.mjk.manager.magicapi.plugin.webservice.model.WebServiceInfo;

/**
 * 定义webservice 分组类型
 */
public class WebServiceMagicResourceStorage extends AbstractPathMagicResourceStorage<WebServiceInfo> {

    @Override
    public String folder() {
        return "webservice";
    }

    @Override
    public Class<WebServiceInfo> magicClass() {
        return WebServiceInfo.class;
    }

    @Override
    public void validate(WebServiceInfo entity) {
        notBlank(entity.getPath(), WEBSERVICE_PAT_NULL);
    }

    @Override
    public String buildMappingKey(WebServiceInfo info) {
        return buildMappingKey(info, magicResourceService.getGroupPath(info.getGroupId()));
    }
}
